<?php
class BrandAction extends Action
{
    public function getDirs($path)
    {
        $dirs = array();
        $d = dir($path);
        while (false !== ($entry = $d->read())) {
            if ($entry != '.' && $entry != '..' && $entry != '.svn') {
                $dirs[] = $entry;
            }
        }
        return $dirs;
    }

    public function different()
    {
        $dirs = $this->getDirs('D:/SVN/material-slide');
        dump(count($dirs));
        echo '<table>';
        foreach ($dirs as $key => $dir) {
            $dir = explode('-', $dir);
            $map['b_name'] = auto_charset($dir[1]);
            $bid = D('Mall')->findOne('m_brand', 'b_id', $map);
            echo '<tr><td>' . $dir[0] . '-' . auto_charset($dir[1]) . '</td><td>' .intval($bid['b_id']).'</td></tr>';
        }
        echo '</table>';
    }
}